

package com.scs.application.modules.base.dto;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.handler.inter.IExcelDataModel;
import cn.afterturn.easypoi.handler.inter.IExcelModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.scs.application.core.model.DataEntity;
import com.scs.application.core.utils.excel.annotation.ExcelAutoColumnSize;
import com.scs.application.core.utils.excel.annotation.ExcelComment;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 商品品类实体对象
 *
 */
@TableName("material_catalog")
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@Accessors(chain = true)
@ExcelAutoColumnSize
public class ExcelMaterialCatalogDTO extends DataEntity implements IExcelDataModel, IExcelModel, Serializable {

    /**
     * 商品类型 : 1：药品，2：耗材，3：试剂。 字典类型：base_material_type
     */
    @ExcelComment(dict = "base_material_type", example = "2")
    @Excel(name = "商品类型", dict = "base_material_type")
    @NotNull(message = "商品类型不能为空")
    private String materialTypeCode;

    /**
     * 品类代码
     */
    @ExcelComment(value = "品类代码", notNull = true, example = "cat001")
    @Excel(name = "品类代码")
    @NotBlank(message = "品类代码不能为空")
    @Length(min = 1, max = 20, message = "品类代码长度必须介于 1 和 20 之间")
    private String code;

    /**
     * 品类名称
     */
    @ExcelComment(notNull = true, example = "品类测试")
    @Excel(name = "品类名称")
    @NotBlank(message = "品类名称不能为空")
    @Length(min = 1, max = 20, message = "品类名称长度必须介于 1 和 20 之间")
    private String name;

    /**
     * 品类全称
     */
    @ExcelComment(example = "品类测试")
    @Excel(name = "品类全称")
    @NotBlank(message = "品类全称不能为空")
    @Length(min = 1, max = 50, message = "品类全称长度必须介于 1 和 50 之间")
    private String fullName;

    /**
     * 父级品类代码
     */
    @ExcelComment(value = "可空;68分类代码", example = "cat001,为空则为根分类")
    @Excel(name = "父级品类代码")
    private String parentCode;

    /**
     * 父级品类名称
     */
    @ExcelComment(example = "器械")
    @Excel(name = "父级品类名称")
    private String parentName;

    private Integer rowNum;
    private String errorMsg;

    @Override
    public Integer getRowNum() {
        return rowNum;
    }

    @Override
    public void setRowNum(Integer rowNum) {
        this.rowNum = rowNum;
    }

    @Override
    public String getErrorMsg() {
        return errorMsg;
    }

    @Override
    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

}
